<template>
  <view>
    <test></test>
    <test v-if="flag"></test>
    <button type="primary" @click="checkTest">切换test组件</button>
	<test :title="title" :name="name"></test>
	<test :title="title" @myEvent="getNum"></test>这是子组件传递过来的数据{{num}}
	<test-a></test-a>
	<test-b></test-b>
	<uni-calendar
	:insert='true'
	:lunar="true"
	:start-date="'2019-3-2'"
	:end-date="'2019-2-20'"
	@change="change"
	></uni-calendar>
  </view>
</template>

<script>
	import test from '../../../pages/components/uni-calender/test.vue'
	import testA from '../../pages/components/uni-calender/a.vue'
	import testB from '../../pages/components/uni-calender/b.vue'
	import uniCalendar from '@/components/uni-calendar/uni-calendar.vue'
	export default {
	  data() {
	    return {
	      title: 'Hello',
	      name: 'lilinlgi',
	      num: 0,
	      flag: true
	    }
	  },
	  components: {
	    test,
	    "test-a": testA,
	    "test-b": testB,
	    uniCalendar
	  },
	  methods: {
	    checkTest() {
	      this.flag = !this.flag
	    },
	    getNum (num) {
	      // 此处可补充 getNum 方法的具体逻辑
		  console.log(num)
	    }
	  }
	}
</script>